1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| #include<stdio.h> #include<cstring> #include<algorithm> #include<string.h> #include<iostream> #include<cmath> #include<map> #include<queue> #include<numeric> #include<set> #pragma comment(linker, "/STACK:10240000000,10240000000") using namespace std; #define mem(x,y) memset(x,y,sizeof(x)) #define inf 0x3f3f3f3f #define debug puts("-----") #define maxn 50000+4 #define uLL unsigned long long #define LL long long int day[700]; int mo[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n; scanf("%d",&n); int m,d,p,t; mem(day,0); for(int i=0;i<n;i++) { scanf("%d%d%d%d",&m,&d,&p,&t); int date=0; for(int j=0;j<m;j++) date+=mo[j]; date+=d; date+=150; int st=date-t; int cnt=0; for(;st<date;st++) day[st]+=p; } int ans=0; for(int i=0;i<700;i++) ans=max(ans,day[i]); printf("%d\n",ans); }
|